home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_300
/
352_01
/
vecznorm.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1991-04-22
|
591b
|
23 lines
//////// COMPLEX VECTORS
//
// VECZNORM.CPP
// norm of a complex vector = sum of norms of complex elements
// also equals sum of norms of real and imag vector parts.
//
#include <stdlib.h>
#include <alloc.h>
#include <string.h>
#include "wtwg.h"
#include "dblib.h"
#include "vector.h"
float norm (CVector& vec, int n1, int n2 )
// norm between point1 and point2 (friend function of CVector)
// if point2 == -1, sums to end of V.
{
return ( norm(vec.x,n1,n2) + norm(vec.y,n1,n2) );
}
//---------------------- end VECZNORM.CPP ----------------------------